﻿<UserControl x:Class="CustomerManagement.WorkerList.NewCustomerListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
    xmlns:inf="clr-namespace:RentAWorker.Management.Infrastructure;assembly=RentAWorker.Management.Infrastructure"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Margin="10" Grid.Column="0">
            <TextBlock VerticalAlignment="Center">Customer Name:</TextBlock>
            <TextBox Name="SearchTextBox" MinWidth="150" Margin="10,0,10,0" />
            <Button Command="{Binding SearchCommand}"
                    CommandParameter="{Binding ElementName=SearchTextBox,Path=Text}">Search</Button>
        </StackPanel>

        <ListBox ItemsSource="{Binding CustomerList}" Grid.Column="1">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <inf:RadialPanel />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding CustomerID}" />
                        <TextBlock Text="{Binding Name}" />
                    </StackPanel> 
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
